package com.kfm.base.branch;

public class SwitchDemo02 {

    public static void main(String[] args) {
        /*
            switch 表达式
            switch(){
                case 值 ->  执行代码;
            }
            替换原有的写法
         */

        char grade = 'B';
        double comm = 0;


        switch (grade) {
            case 'A', 'a' -> {
                System.out.println("秀儿");
                comm = 1000;
            }
            case 'B' -> {
                System.out.println("良好");
                System.out.println('B');
                comm = 500;
            }
            case 'C' -> {
                System.out.println("一般");
                comm = 300;
            }
            default -> {
                System.out.println("继续努力");
                comm = 100;
            }
        }
        System.out.printf("本月的奖金是：%f \n", comm);
    }
}
